--TEST--
CTPP Output (OO-style)
--FILE--
<?php
	error_reporting(E_ERROR);

	ini_set("ctpp.arg_stack_size",       "10240");
	ini_set("ctpp.code_stack_size",      "10240");
	ini_set("ctpp.steps_limit",          "10240");
	ini_set("ctpp.cache_bytecode",       "0");
	ini_set("ctpp.max_functions",        "1024");

	// Create Data structure
	$Data = Array (
		"d"    => 11111,
		"s1"   => "Hello, World!"  ,
		"s2"   => +1,
		"s3"   => -100,
		"s4"   => 123.45E+3,
		"s5"   => -123.0,
		"s6"   => true,
		"s7"   => false,
		"s8"   => 0,
		"Escape" => "Need to escape \' \\u0027 \u0027 -=(&\":\"&)=-",

		"loop" => Array( Array ( "a" => 1, "s1" => "First loop!", "what_test" => "OO-style" ),
		          Array ( "a" => 2, "s1" => "Second loop!", "inner_loop" => Array( Array( "a" => "1" ), Array( "a" =>  2.0 ), Array( "a" => 3 ) ) ),
		          Array ( "a" => 3 ),
		          Array ( "a" => 4 )
		)
	);
	// Create new class
	$T = new ctpp();

	$template = $T -> load_bytecode("7.ct2");
	// Load bytecode
	if (!is_resource($template)) { exit(); }

	// Insert some parameters
	$T -> emit_params($Data);
	$T -> emit_params(Array("somedata" => "data"));

	// Print output
	$T -> output($template);
	// Print output as string
	echo $T -> output_string($template);

?>
--EXPECT--
This is header.tmpl
Need to escape \&#39; \u0027 \u0027 -=(&amp;&quot;:&quot;&amp;)=-
Need+to+escape+%5C%27+%5Cu0027+%5Cu0027+-%3D%28%26%22%3A%22%26%29%3D-

Loop:


	Iteration: 1 of 4.
	In included file: First loop!, Even/odd: Odd!
	Really first loop
	1


	Iteration: 2 of 4.
	In included file: Second loop!, Even/odd: Even!
	Inner loop
	2 Inner Loop: {  {1}  {2}  {3} }


	Iteration: 3 of 4.
	In included file: Hello, World!, Even/odd: Odd!
	Inner loop
	3


	Iteration: 4 of 4.
	In included file: Hello, World!, Even/odd: Even!
	Really last loop
	4


Direct loop access: OO-style

This is footer.tmpl

This is header.tmpl
Need to escape \&#39; \u0027 \u0027 -=(&amp;&quot;:&quot;&amp;)=-
Need+to+escape+%5C%27+%5Cu0027+%5Cu0027+-%3D%28%26%22%3A%22%26%29%3D-

Loop:


	Iteration: 1 of 4.
	In included file: First loop!, Even/odd: Odd!
	Really first loop
	1


	Iteration: 2 of 4.
	In included file: Second loop!, Even/odd: Even!
	Inner loop
	2 Inner Loop: {  {1}  {2}  {3} }


	Iteration: 3 of 4.
	In included file: Hello, World!, Even/odd: Odd!
	Inner loop
	3


	Iteration: 4 of 4.
	In included file: Hello, World!, Even/odd: Even!
	Really last loop
	4


Direct loop access: OO-style

This is footer.tmpl
